import request from '@/utils/request'

// 创建文件落实
export function createDocumentImpl(data) {
  return request({
    url: '/biz/document-impl/create',
    method: 'post',
    data: data
  })
}

// 更新文件落实
export function updateDocumentImpl(data) {
  return request({
    url: '/biz/document-impl/update',
    method: 'put',
    data: data
  })
}

// 删除文件落实
export function deleteDocumentImpl(id) {
  return request({
    url: '/biz/document-impl/delete?id=' + id,
    method: 'delete'
  })
}

// 获得文件落实
export function getDocumentImpl(id) {
  return request({
    url: '/biz/document-impl/get?id=' + id,
    method: 'get'
  })
}

// 获得文件落实分页
export function getDocumentImplPage(query) {
  return request({
    url: '/biz/document-impl/page',
    method: 'get',
    params: query
  })
}

// 导出文件落实 Excel
export function exportDocumentImplExcel(query) {
  return request({
    url: '/biz/document-impl/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function showAttach(path){
  return request({
    url: '/biz/document-impl/getAttach?path='+path,
    method: 'get'
  })
}

// 下载文件落实导入模板
export function downloadTemplate() {
  return request({
    url: '/biz/document-impl/downAttachTemplate',
    method: 'post',
    responseType: 'blob'
  })
}
